package com.execjar;

import cn.hutool.core.io.FileUtil;
import org.junit.Test;

import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.stream.Collectors;

public class ReadFile {

    @Test
    public void readFile() {
        String path = "/Users/zhuzi/workspace/soft/ideatool/idea/execjar/execjar.log";
        List<String> list = FileUtil.readLines(path, StandardCharsets.UTF_8);
        List<String> collect = list.stream().filter(str -> str.contains("192.168.50.52")).collect(Collectors.toList());
        for (String s : collect) {
            System.out.println(s);
        }
    }
}
